/*
入口 JS
*/
import React from 'react';
import ReactDOM from 'react-dom';
import {HashRouter, Switch, Route} from 'react-router-dom'
import Login from './containers/login/login'
import Register from './containers/register/register'
import Main from './containers/main/main'
import {Provider} from 'react-redux'
import store from './redux/store'


ReactDOM.render(
    /* 此处需要用Provider包裹App，目的是让App所有的后代容器组件都能接收到store */
    (<Provider store={store}>
        <HashRouter>
            <Switch>
                <Route path='/login' component={Login}/>
                <Route path='/register' component={Register}/>
                {/*默认路由*/}
                <Route component={Main}/>
            </Switch>
        </HashRouter>
    </Provider>)
,
  document.getElementById('root')
);

